home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MLT_TASK / PIBMDOS / READKBD.PAS < prev    next >
Pascal/Delphi Source File  |  1988-03-14  |  2KB  |  37 lines

  1. (*----------------------------------------------------------------------*)
  2. (*            Read_Kbd --- Read one character from keyboard             *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Read_Kbd( VAR Ch: CHAR );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Read_Kbd                                             *)
  10. (*                                                                      *)
  11. (*     Purpose:    Reads one character from the keyboard                *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Read_Kbd( VAR Ch: CHAR );                                     *)
  16. (*                                                                      *)
  17. (*           Ch  --- Character read                                     *)
  18. (*                                                                      *)
  19. (*     Remarks:                                                         *)
  20. (*                                                                      *)
  21. (*        This routine centralizes single character keyboard reads so   *)
  22. (*        that time-slicing control for multitaskers is more easily     *)
  23. (*        centralized.  In this particular implementation, the time     *)
  24. (*        spent waiting for a keyboard entry is donated to the other    *)
  25. (*        partitions.                                                   *)
  26. (*                                                                      *)
  27. (*----------------------------------------------------------------------*)
  28.  
  29. BEGIN (* Read_Kbd *)
  30.  
  31.    WHILE ( NOT KeyPressed ) DO
  32.       GiveUpTime( 2 );
  33.  
  34.    Ch := ReadKey;
  35.  
  36. END   (* Read_Kbd *);
  37.